import 'package:kkhousekeep/generated/json/base/json_convert_content.dart';
import 'package:kkhousekeep/models/repair_fault_type_entity.dart';

RepairFaultTypeEntity $RepairFaultTypeEntityFromJson(Map<String, dynamic> json) {
	final RepairFaultTypeEntity repairFaultTypeEntity = RepairFaultTypeEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		repairFaultTypeEntity.code = code;
	}
	final List<RepairFaultTypeObj>? obj = jsonConvert.convertListNotNull<RepairFaultTypeObj>(json['obj']);
	if (obj != null) {
		repairFaultTypeEntity.obj = obj;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		repairFaultTypeEntity.msg = msg;
	}
	return repairFaultTypeEntity;
}

Map<String, dynamic> $RepairFaultTypeEntityToJson(RepairFaultTypeEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['obj'] =  entity.obj.map((v) => v.toJson()).toList();
	data['msg'] = entity.msg;
	return data;
}

RepairFaultTypeObj $RepairFaultTypeObjFromJson(Map<String, dynamic> json) {
	final RepairFaultTypeObj repairFaultTypeObj = RepairFaultTypeObj();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		repairFaultTypeObj.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		repairFaultTypeObj.name = name;
	}
	return repairFaultTypeObj;
}

Map<String, dynamic> $RepairFaultTypeObjToJson(RepairFaultTypeObj entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	return data;
}